//
//  NSString+QTZ.h
//  QTZ
//
//  Created by ski on 2017/7/5.
//  Copyright © 2017年 ski. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (QTZ)

/**
 *  给 URL 添加参数
 *
 *  @param params 参数字典
 *
 *  @return 拼接后的 URL
 */
- (NSString *)addParamsToUrlFromDictionary:(NSDictionary *)params;

/**
 *  对字符串进行 urlencode
 *
 *  @return urlencode 后的字符串
 */
- (NSString *)urlencode;

/**
 *  对字符串进行 urldecode
 *
 *  @return urldecode 后的字符串
 */
- (NSString *)urldecode;

/**
 *  计算字符串的 MD5
 *
 *  @return MD5
 */
- (NSString *)MD5;

/**
 *  去除字符串中的空格、回车等
 */
- (NSString *)trim;

/**
 *  计算文本Size
 */
- (CGSize)sizeWithUIFont:(UIFont *)font forWidth:(CGFloat)width;

/**
 *  计算文本Size sizeWithUIFont实际上是调用了该方法
 */
- (CGSize)sizeWithUIAttribute:(NSDictionary *)attribute forWidth:(CGFloat)width;
/**
 *  时间戳转字符串
 */
- (NSString *)stringFromDataWithFormatter:(NSDateFormatter *)formatter;

+ (NSString *)jsonStringWithDict:(NSDictionary *)dict;

//根据时间戳算日期
+ (NSString *)stringWithDate:(NSString *)date;
//根据时间戳算时间
+ (NSString *)stringWithTime:(NSString *)time;
//金额加,
+ (NSString *)countNumAndChangeformat:(NSString *)num;
//字符串密文
+ (NSString *)replaceStringWithAsterisk:(NSString *)originalStr startLocation:(NSInteger)startLocation lenght:(NSInteger)lenght;
//银行卡格式
+ (NSString *)getNewBankNumWitOldBankNum:(NSString *)bankNum;
//标名
+ (NSString *)projectNameWithType:(NSString *)type businessType:(NSString *)businessType name:(NSString *)name;

@end
